<template>
  <div>
    <van-nav-bar
      title="标题"
      left-text="返回"
      right-text="保存"
      left-arrow
      @click-left="$router.go(-1)"
      @click-right="onClickRight"
    />
    <van-cell-group inset>
      <van-field v-model="value" />
    </van-cell-group>
  </div>
</template>

<script>
import { Toast } from 'vant';
import { getuser, userInfo } from "../../../request/http";
export default {
  data() {
    return {
      value: "",
      list: [],
    };
  },
  created() {
    console.log(this.$route.query.nickname);
    this.value = this.$route.query.nickname;
  },
  methods: {
    onClickRight() {
      getuser({nickname: this.value}).then((res) => {
        console.log(res);
        Toast.success("修改成功");
        this.$router.push("/info")
      });
    },
  },
};
</script>

<style lang="scss" scoped>
</style>